package com.itstyle.seckill.topic.desinger.design_cj.proxy.dynamicProxy;


import com.itstyle.seckill.topic.desinger.design_cj.proxy.RealSubject;
import com.itstyle.seckill.topic.desinger.design_cj.proxy.Subject;

/**
 * @Auther: liuwenxiang
 * @Date: 2019/11/13 19:52
 * @Description:
 */
public class Client {

    public static void main(String[] args) {
        // 保存生成的代理类的字节码文件
        System.getProperties().put("sun.misc.ProxyGenerator.saveGeneratedFiles", "true");

        // jdk动态代理测试
        //1.通过动态代理，得到代理对象
        Subject subject = new JDKDynamicProxy(new RealSubject()).getProxy();
        //2.执行目标对象的方法，实际执行了代理类的invoke方法
        subject.request();
    }

}
